/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server;

/**
 *
 * @author Reinhard
 */
public class Request {
  String file_name;
  int port;
  int uploaded;
  int downloaded;
  int left;
  String event=""; // default
  
  public static void main(String[] args) {
    Request tr = new Request("haha", 1, 1, 1, 1, "");
    System.out.println(tr.getRequestString());
  }
  
  public Request(String file_name, int port, int uploaded, int downloaded, int left, String event) {
    this.file_name = file_name;
    this.port = port;
    this.uploaded = uploaded;
    this.downloaded = downloaded;
    this.left = left;
    this.event = event;
  }
  
  public String getRequestString() {
    StringBuilder sb = new StringBuilder();
    sb.append(file_name);
    sb.append("&");
    sb.append(Integer.toString(port));
    sb.append("&");
    sb.append(Integer.toString(uploaded));
    sb.append("&");
    sb.append(Integer.toString(downloaded));
    sb.append("&");
    sb.append(Integer.toString(left));
    sb.append("&");
    sb.append(event);
    return sb.toString();
  }
  
}
